<?php
/**
 * User:chendenan
 * Created On 2022/3/21 0021 17:20
 */
namespace app\api\controller\mall;
use app\api\controller\AuthBase;
use app\common\business\Cart;
use app\common\lib\Show;

class Init extends AuthBase {
    public function index(){
        if(!$this->request->isPost()){
            return Show::error("非法请求");
        }
        $count = (new Cart())->getCart($this->userId);
        $result = [
            "cart_num" => $count,
        ];
        return Show::success($result);
    }
}